package com.gdust.gkyx.sys.controller;

import com.gdust.gkyx.common.result.Result;
import com.gdust.gkyx.model.sys.Ware;
import com.gdust.gkyx.sys.service.WareService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: WareController
 * Package: com.gdust.gkyx.sys.controller
 * Description:
 *
 * @Author syun
 * @Create 2025/1/24 13:54
 * @Version 1.0
 */
@Api(tags = "仓库接口")
@RestController
@RequestMapping("/admin/sys/ware")
//@CrossOrigin
public class WareController {
    //注入仓库表的service
    @Autowired
    private WareService wareService;

    /**
     *     //查询所有仓库列表
     * //    url: `${api_name}/findAllList`,
     * //    method: 'get'
     * @return
     */
    @ApiOperation("查询所有仓库列表")
    @GetMapping("findAllList")
    public Result findAllList() {
        List<Ware> list = wareService.list();
        return Result.ok(list);
    }
}
